package me.xplabs.model.skill 
{
	import flash.utils.getTimer;
	import me.xplabs.interfaces.IObjectMatrix;
	import me.xplabs.model.combatunit.MRoleInfo;
	/**
	 * http://www.xplabs.me/
	 * @author xiaohan
	 */
	public class MSkillInfo extends BaseSkill implements IObjectMatrix
	{
		public var startX:int;
		public var startY:int;
		public var endX:int;
		public var endY:int;
		//当前所在的x坐标
		private var _curPosX:Number;
		//当前所在的y坐标
		private var _curPosY:Number;
		private var _soleId:int;
		public var attackRoleId:int;
		//public var curRoleInfo:MRoleInfo;
		private var _angle:Number;
		public function MSkillInfo() 
		{
			curPosX = 0;
			curPosY = 0;
		}
		public function heartbeat(prev:uint):Boolean 
		{
			/*var dx:Number = endX - curPosX;
			var dy:Number = endY - curPosY;
			var tempAngle:Number = Math.atan2(dy, dx);
			var angle:Number = tempAngle * 180 / Math.PI;
			var vx:Number = Math.cos(tempAngle) * speed;
			var vy:Number = Math.sin(tempAngle) * speed;
			//curPosX = curPosX + vx;
			//curPosY = curPosY + vy;
			//trace("变化前==" + curPosX, curPosY);
			setCurPos(curPosX + vx, curPosY + vy);
			if (Math.sqrt(dx * dx + dy * dy) > speed) return false;
			setCurPos(endX, endY);*/
			return true;
		}
		public function setCurPos(p_x:Number, p_y:Number):void
		{
			curPosX = p_x;
			curPosY = p_y;
		}
		public function dispose():void
		{
			curPosX = 0;
			curPosY = 0;
			soleId = 0;
			startX = 0;
			startY = 0;
			endX = 0;
			endY = 0;
		}   
		
		public function get angle():Number 
		{
			return _angle;
		}
		
		public function set angle(value:Number):void 
		{
			_angle = value;
		}
		
		public function get curPosX():Number 
		{
			return _curPosX;
		}
		
		public function set curPosX(value:Number):void 
		{
			_curPosX = value;
		}
		
		public function get curPosY():Number 
		{
			return _curPosY;
		}
		
		public function set curPosY(value:Number):void 
		{
			_curPosY = value;
		}
		
		public function get soleId():int 
		{
			return _soleId;
		}
		
		public function set soleId(value:int):void 
		{
			_soleId = value;
		}
	}       
}           